class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.o: F = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.o: F = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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