class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.o: A = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.x: E = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.v: C = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.p: C = None
        self.w: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

m = A("m")
c = B("c")
k = C("k")
b = D("b")
i = E("i")
h = F("h")

m.y = h
m.t = h
c.x = k
k.p = m
k.o = m
k.w = h
k.v = i
b.o = k
b.s = h
b.t = h
b.x = i
i.o = h
i.p = k
i.v = k
i.q = k
i.t = m
h.q = m
h.u = k
h.p = k
h.w = k
h.y = k
h.o = b
assert c.x.w.o.o.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.o: A = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.x: E = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.v: C = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: C = None
        self.p: C = None
        self.w: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

m = A("m")
c = B("c")
k = C("k")
b = D("b")
i = E("i")
h = F("h")

m.y = h
m.t = h
c.x = k
k.p = m
k.o = m
k.w = h
k.v = i
b.o = k
b.s = h
b.t = h
b.x = i
i.o = h
i.p = k
i.v = k
i.q = k
i.t = m
h.q = m
h.u = k
h.p = k
h.w = k
h.y = k
h.o = b
assert c.x.w.o.o.w.o.txt == "b"