class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.y: D = None
        self.z: D = None
        self.v: E = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.t: B = None
        self.v: A = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.y: D = None
        self.z: D = None
        self.v: E = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.t: B = None
        self.v: A = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

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