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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: E = None
        self.x: D = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

f = A("f")
i = B("i")
g = C("g")
h = D("h")
e = E("e")
c = F("c")
m = C("m")
j = D("j")

f.w = j
f.p = h
f.u = h
f.o = h
f.y = e
f.z = c
i.v = g
i.u = f
i.q = f
i.p = j
g.s = f
g.o = f
h.u = c
e.t = f
e.v = f
e.z = j
c.z = e
c.v = e
c.x = j
c.u = i
c.w = f
m.s = f
m.o = f
j.u = c
assert g.s.w.u.u.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.u: D = None
        self.y: E = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: E = None
        self.x: D = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

f = A("f")
i = B("i")
g = C("g")
h = D("h")
e = E("e")
c = F("c")
m = C("m")
j = D("j")

f.w = j
f.p = h
f.u = h
f.o = h
f.y = e
f.z = c
i.v = g
i.u = f
i.q = f
i.p = j
g.s = f
g.o = f
h.u = c
e.t = f
e.v = f
e.z = j
c.z = e
c.v = e
c.x = j
c.u = i
c.w = f
m.s = f
m.o = f
j.u = c
assert g.s.w.u.u.u.o.u.txt == "c"