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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: E = None
        self.s: C = None
        self.v: A = None
        self.z: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

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

l = A("l")
d = B("d")
f = C("f")
g = D("g")
c = E("c")
b = F("b")
j = F("j")
n = E("n")

l.y = g
l.z = g
l.w = n
l.o = f
l.x = f
l.v = d
d.x = l
d.q = g
d.r = g
d.t = f
f.y = d
f.v = g
f.q = g
g.r = d
g.y = d
g.x = n
g.s = f
g.v = l
g.z = l
c.r = j
c.s = n
c.q = f
b.v = n
b.s = l
b.y = f
b.p = j
b.q = d
j.v = c
j.s = l
j.y = f
j.p = b
j.q = d
n.r = j
n.s = c
n.q = f
assert d.t.v.z.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: E = None
        self.o: C = None
        self.v: B = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: E = None
        self.s: C = None
        self.v: A = None
        self.z: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

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

l = A("l")
d = B("d")
f = C("f")
g = D("g")
c = E("c")
b = F("b")
j = F("j")
n = E("n")

l.y = g
l.z = g
l.w = n
l.o = f
l.x = f
l.v = d
d.x = l
d.q = g
d.r = g
d.t = f
f.y = d
f.v = g
f.q = g
g.r = d
g.y = d
g.x = n
g.s = f
g.v = l
g.z = l
c.r = j
c.s = n
c.q = f
b.v = n
b.s = l
b.y = f
b.p = j
b.q = d
j.v = c
j.s = l
j.y = f
j.p = b
j.q = d
n.r = j
n.s = c
n.q = f
assert d.t.v.z.z.r.txt == "d"