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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.w: E = None
        self.u: C = None
        self.y: F = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.w: E = None
        self.u: C = None
        self.y: F = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

b.y = c
b.o = c
h.w = j
h.r = g
h.z = c
n.u = b
n.v = b
n.y = j
n.o = h
n.r = l
n.q = f
c.r = g
c.x = e
c.p = n
f.v = b
l.p = e
g.v = f
g.w = f
g.o = b
g.x = b
g.u = j
g.y = l
g.t = c
j.u = b
j.v = b
j.y = n
j.o = h
j.r = l
j.q = f
e.p = l
assert f.v.y.x.p.p.p.p.p.p.txt == "e"