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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: C = None
        self.x: B = None
        self.p: G = None
        self.s: G = None
        self.z: B = None
        self.u: G = None
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: C = None
        self.x: B = None
        self.p: G = None
        self.s: G = None
        self.z: B = None
        self.u: G = None
        self.v: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: G = None
        self.y: C = None
        self.txt = txt

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

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