class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: A = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: B = None
        self.o: G = None
        self.x: D = None
        self.q: G = None
        self.txt = txt

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

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

a.u = f
f.x = b
f.u = a
f.y = e
e.o = a
e.p = h
e.x = f
m.w = l
m.x = l
b.p = a
b.w = l
n.w = c
n.t = f
n.o = l
n.q = l
n.x = m
l.y = b
l.o = b
l.q = b
l.x = f
l.v = f
h.p = a
h.w = l
c.w = n
c.t = f
c.o = l
c.q = l
c.x = m
assert e.p.w.q.p.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: A = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: B = None
        self.o: G = None
        self.x: D = None
        self.q: G = None
        self.txt = txt

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

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

a.u = f
f.x = b
f.u = a
f.y = e
e.o = a
e.p = h
e.x = f
m.w = l
m.x = l
b.p = a
b.w = l
n.w = c
n.t = f
n.o = l
n.q = l
n.x = m
l.y = b
l.o = b
l.q = b
l.x = f
l.v = f
h.p = a
h.w = l
c.w = n
c.t = f
c.o = l
c.q = l
c.x = m
assert e.p.w.q.p.u.u.u.txt == "f"