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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.x: E = None
        self.q: D = None
        self.r: A = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.x: E = None
        self.q: D = None
        self.r: A = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

l.s = h
i.p = j
i.q = j
i.w = l
i.r = l
i.x = h
i.s = h
i.y = n
n.r = g
n.v = j
j.t = l
j.s = l
j.q = i
h.o = l
h.y = j
g.t = a
a.t = h
a.u = i
b.r = g
b.v = j
f.r = g
f.v = j
assert l.s.y.q.p.t.s.txt == "h"