class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: F = None
        self.t: H = None
        self.r: F = None
        self.v: F = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.z: E = None
        self.w: G = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.z: E = None
        self.w: G = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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

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