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

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

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

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

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

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

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

d.r = i
d.t = l
d.s = n
b.w = l
b.v = k
b.r = g
b.q = n
b.s = n
k.r = b
k.z = g
k.s = l
k.x = i
k.w = d
k.t = d
n.r = h
l.s = d
l.r = d
l.o = h
a.x = n
i.w = l
i.v = k
i.r = g
i.s = g
i.q = n
f.r = b
f.z = n
f.s = l
f.x = i
f.w = d
f.t = d
h.x = n
g.r = a
assert f.x.w.o.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

d.r = i
d.t = l
d.s = n
b.w = l
b.v = k
b.r = g
b.q = n
b.s = n
k.r = b
k.z = g
k.s = l
k.x = i
k.w = d
k.t = d
n.r = h
l.s = d
l.r = d
l.o = h
a.x = n
i.w = l
i.v = k
i.r = g
i.s = g
i.q = n
f.r = b
f.z = n
f.s = l
f.x = i
f.w = d
f.t = d
h.x = n
g.r = a
assert f.x.w.o.x.r.txt == "h"