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

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

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

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

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

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

g = A("g")
b = B("b")
i = C("i")
l = D("l")
k = E("k")
e = F("e")
f = E("f")

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

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

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

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

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

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

g = A("g")
b = B("b")
i = C("i")
l = D("l")
k = E("k")
e = F("e")
f = E("f")

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