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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: G = None
        self.t: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: E = None
        self.o: A = None
        self.t: C = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: G = None
        self.t: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: E = None
        self.o: A = None
        self.t: C = None
        self.s: E = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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