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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: F = None
        self.o: B = None
        self.s: F = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.t: C = None
        self.w: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.t: E = None
        self.z: D = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: F = None
        self.o: B = None
        self.s: F = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.t: C = None
        self.w: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.t: E = None
        self.z: D = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

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

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