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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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