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

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

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

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

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

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

c = A("c")
i = B("i")
k = C("k")
b = D("b")
g = E("g")
l = F("l")
j = E("j")

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

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

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

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

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

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

c = A("c")
i = B("i")
k = C("k")
b = D("b")
g = E("g")
l = F("l")
j = E("j")

c.v = j
c.y = l
c.z = l
c.x = l
c.r = l
c.u = i
i.r = c
i.t = k
k.w = i
k.y = c
k.p = c
b.t = j
b.u = k
b.z = k
b.s = c
b.r = g
g.y = b
l.u = c
j.y = b
assert b.s.x.u.v.txt == "j"