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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: C = None
        self.t: B = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

g.x = f
f.s = g
f.v = l
f.t = d
f.r = k
f.u = j
c.q = g
c.t = g
c.z = e
c.w = d
c.u = j
e.r = b
j.u = m
j.p = e
m.x = b
m.t = f
m.s = c
d.s = g
d.v = l
d.t = f
d.r = m
d.u = j
l.q = g
l.t = g
l.z = b
l.w = f
l.u = j
k.x = e
k.t = d
k.s = l
b.r = e
assert j.u.x.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: C = None
        self.t: B = None
        self.r: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

g.x = f
f.s = g
f.v = l
f.t = d
f.r = k
f.u = j
c.q = g
c.t = g
c.z = e
c.w = d
c.u = j
e.r = b
j.u = m
j.p = e
m.x = b
m.t = f
m.s = c
d.s = g
d.v = l
d.t = f
d.r = m
d.u = j
l.q = g
l.t = g
l.z = b
l.w = f
l.u = j
k.x = e
k.t = d
k.s = l
b.r = e
assert j.u.x.r.r.r.r.txt == "b"