class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.u: G = None
        self.y: E = None
        self.s: F = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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