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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: F = None
        self.p: B = None
        self.r: D = None
        self.t: C = None
        self.o: B = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: F = None
        self.p: B = None
        self.r: D = None
        self.t: C = None
        self.o: B = None
        self.s: G = None
        self.txt = txt

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

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

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

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