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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

l.x = b
e.t = f
e.p = f
n.v = l
n.z = f
n.t = e
n.x = g
f.r = b
f.z = n
f.s = l
f.y = g
b.v = g
g.u = l
g.x = f
g.v = f
g.q = d
g.t = b
g.s = n
d.t = f
d.p = f
assert b.v.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

l.x = b
e.t = f
e.p = f
n.v = l
n.z = f
n.t = e
n.x = g
f.r = b
f.z = n
f.s = l
f.y = g
b.v = g
g.u = l
g.x = f
g.v = f
g.q = d
g.t = b
g.s = n
d.t = f
d.p = f
assert b.v.s.x.txt == "g"