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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

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

c.r = a
c.p = e
c.w = l
c.y = l
c.u = j
c.s = j
c.v = m
a.u = c
a.p = l
a.y = l
a.w = j
l.o = b
l.v = b
b.r = m
b.z = c
m.p = a
e.w = b
e.s = l
e.y = a
e.o = m
j.r = a
j.y = m
f.w = b
f.s = l
f.y = a
f.o = m
assert l.o.r.p.u.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.w: C = None
        self.y: C = None
        self.u: G = None
        self.v: E = None
        self.s: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: C = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

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

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

c.r = a
c.p = e
c.w = l
c.y = l
c.u = j
c.s = j
c.v = m
a.u = c
a.p = l
a.y = l
a.w = j
l.o = b
l.v = b
b.r = m
b.z = c
m.p = a
e.w = b
e.s = l
e.y = a
e.o = m
j.r = a
j.y = m
f.w = b
f.s = l
f.y = a
f.o = m
assert l.o.r.p.u.p.o.txt == "m"