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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: C = None
        self.u: E = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: C = None
        self.u: E = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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