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

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

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

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

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

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

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

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

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

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

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

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

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

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

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