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

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

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

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

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

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

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

j.z = f
j.u = f
e.u = g
e.w = g
e.x = l
c.p = j
f.s = l
f.t = l
f.u = l
f.r = c
g.y = j
l.v = e
assert j.z.r.p.z.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

j.z = f
j.u = f
e.u = g
e.w = g
e.x = l
c.p = j
f.s = l
f.t = l
f.u = l
f.r = c
g.y = j
l.v = e
assert j.z.r.p.z.u.v.txt == "e"